package com.zhou.JavaAndroidFirm.presenter;

import com.zhou.JavaAndroidFirm.bean.NewsSummary;
import com.zhou.JavaAndroidFirm.constract.NewsListConstract;
import com.zhou.JavaAndroidFirm.rx.RxSubscriber;

import java.util.List;

/**
 * @author Administrator
 * @date 2018/7/16 0016
 * @des
 */
public class NewsListPresenter extends NewsListConstract.Presenter {
    @Override
    public void getNewsListData(String type, String id, int startPage) {
        addSubscribe(mModel.getNewsListData(type, id, startPage).subscribe(new RxSubscriber<List<NewsSummary>>(mContext, false) {
            @Override
            protected void _onNext(List<NewsSummary> newsSummaries) {
                mView.returnNewsListData(newsSummaries);

            }

            @Override
            protected void _onError(String message) {
                mView.showTip(message);
            }

        }));
    }
}
